# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-facepy
pkgname=('python2-facepy' 'python-facepy')
_pkgname=facepy
pkgver=1.0.12
pkgrel=6
pkgdesc="Makes it really easy to interact with Facebook's Graph API."
arch=('any')
url='https://github.com/jgorset/facepy'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f803338bb64f98a43197259e927e87da212ce6f4cb6c35e021c78ce69365964a26b473ad531a211a82c9897f2a4f869fcd27ca839c2bb4d910f4818c23516241')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-facepy() {
  depends=('python2' 'python2-requests' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-facepy() {
  depends=('python' 'python-requests' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

